﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Transactions;
using ZFY.DDD.Application;
using ZFY.UnitOfWork;

namespace EFGetStarted
{
    public class BlogSerivce : ApplicationService,IBlogSerivce
    {
        private readonly IBlogRepository _blogRepository;
  

        public BlogSerivce(IBlogRepository blogRepository) 
        {
            _blogRepository = blogRepository;
           
        }

        
        public async Task AddAsync(Blog entity)
        {
            await _blogRepository.AddAsync(entity);
        }
        [UnitOfWork]
        public async Task Create(Blog blog)
        {

            Console.WriteLine(Mapper is null);

            await _blogRepository.AddAsync(blog);
        }
    }
    public interface IBlogSerivce
    {
      
        Task Create(Blog blog);
    }
}
